/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Utils;

import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

/**
 *
 * @author Diego
 */
public class Crypt {

    public Crypt() {
    }
    
    public String encriptar(String s) throws NoSuchAlgorithmException{
        String salida;    
        MessageDigest m = MessageDigest.getInstance("MD5");
        m.update(s.getBytes(), 0, s.length());
        BigInteger i = new BigInteger(1,m.digest());
        salida = String.format("%1$032x", i);         
        return salida;
    }
}
